package com.prothink.service.impl;

import com.prothink.dao.CommentlistDao;
import com.prothink.entity.FenyeNode;
import com.prothink.entity.JsComment;
import com.prothink.service.CommentlistService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @BelongsProject: siyun2
 * @BelongsPackage: com.prothink.service.impl
 * @Author: Jin
 * @CreateTime: 2022-11-28  16:34
 * @Description: TODO
 */
@Service
public class CommentlistServiceImpl implements CommentlistService {
    @Autowired
    private CommentlistDao commentlistDao;
    @Override
    public FenyeNode<JsComment> getCommentlist(JsComment jsComment) {
        FenyeNode<JsComment> commentFenye = new FenyeNode<>();
        List commentlist = commentlistDao.getCommentlist(jsComment);
        commentFenye.setComment(commentlist);
        return commentFenye;
    }

    @Override
    public int getcommentime(Integer integer) {
        return commentlistDao.getcommentime(integer);
    }

    @Override
    public int getcommentnewdate(Integer integer) {

        return commentlistDao.getcommentnewdate(integer);
    }

    @Override
    public int getcommentnewdatenumber(Integer integer) {
        return commentlistDao.getcommentnewdatenumber(integer);
    }

    //    修改拦截状态
        @Override
        public int updcommentblock(int id) {
            commentlistDao.updcommentblock(id ,2);
            return 0;
        }
    //    修改通过状态
    @Override
    public int updcommentpass(int id) {
        commentlistDao.updcommentblock(id ,1);
        return 0;
    }
    //    改成删除状态
    @Override
    public int updcommentdel(int id) {
        commentlistDao.updcommentblock(id ,3);
        return 0;
    }
}
